package com.example.demo.service.impl;

import com.example.demo.dao.userinfoMapper;
import com.example.demo.entity.userinfo;
import com.example.demo.service.UserinfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created by admin on 2018/9/25.
 */
@Service
public class UserinfoServiceImpl implements UserinfoService {

    @Resource
    private userinfoMapper userinfoMapper;

    @Override
    public userinfo grtUserByid(String username) {
        return userinfoMapper.selectByPrimaryKey(username);
    }

    @Override
    public boolean addUser(userinfo record) {
        boolean result = false;
        try {
            userinfoMapper.insertSelective(record);
            result = true;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }
}
